home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / grafix / tools / xanim / xanimamigabeta7 / xanim_cybergfx.c < prev    next >
C/C++ Source or Header  |  1995-09-05  |  1KB  |  56 lines

  1. #include <graphics/gfxbase.h>
  2. #include <graphics/displayinfo.h>
  3. #include <cybergraphics/cybergraphics.h>
  4. #include <proto/cybergraphics.h>
  5. #include <intuition/intuition.h>
  6.  
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <ctype.h>
  10.  
  11. struct    TagItem CModeTags[]=
  12.     {
  13.      CYBRMREQ_Screen,0,
  14.      CYBRMREQ_MinDepth,8,
  15.      CYBRMREQ_MaxDepth,24,
  16.      CYBRMREQ_WinTitle,"Select CyBERgraphics ScreenMode",
  17.      CYBRMREQ_OKText,"OK",
  18.      CYBRMREQ_CancelText,"Cancel",
  19.      CYBRMREQ_MinWidth,160,
  20.      CYBRMREQ_MinHeight,120,
  21.      TAG_DONE
  22.     };
  23.  
  24.  
  25. struct Library *CyberGfxBase;
  26. struct Screen *CyberScr;
  27. ULONG CyberDepth;
  28.  
  29. OpenCyber()
  30. {
  31.     ULONG    ModeID;
  32.     
  33.     if(!(CyberGfxBase=OpenLibrary((UBYTE *)"cybergraphics.library", 40L))) {CloseCyber();exit(20);}
  34.  
  35.     ModeID=CModeRequestTagList(0L,CModeTags);
  36.     if(ModeID==0) {CloseCyber();exit(20);}
  37.     CyberDepth=GetCyberIDAttr(CYBRIDATTR_DEPTH,ModeID);
  38.  
  39.     CyberScr=(struct Screen *)OpenScreenTags(0L,
  40.                             SA_DisplayID,ModeID,
  41.                             SA_ShowTitle,0,
  42.                             SA_Title,0,
  43.                             SA_Quiet,1,
  44.                             SA_AutoScroll,1,
  45.                             SA_Overscan,1,
  46.                             SA_Depth,CyberDepth,
  47.                             TAG_DONE);
  48.     if(!CyberScr) {CloseCyber();exit(20);}
  49. }
  50.  
  51. CloseCyber()
  52. {
  53.     if(CyberScr) CloseScreen(CyberScr);
  54.     if(CyberGfxBase) CloseLibrary(CyberGfxBase);
  55. }
  56.